package com.test

import com.subpackage.CompressJS
import kotlin.system.exitProcess
import kotlin.test.Test

class CompressJSTest {

    @Test
    fun test() {
//        System.setProperty("rootDir", "D:\\WorkSpace\\Idea\\Java\\PackProject")

//        new ContrastFile().compressJS(new File("C:\\Users\\boge\\gamemania\\laya.js"));
        val values = arrayOf(
//            "-O",
//            "ADVANCED",
            "--js",
            "jstest/a.js",
            "jstest/b.js",
            "jstest/c.js",
            "--js_output_file",
            "jstest/a.min.js",
//            "jstest/ooo.js"
        )
        val compressJS = CompressJS(values)
        compressJS.setExitCodeReceiver {
            if (compressJS.hasErrors()) {
                exitProcess(-1)
            }
            null
        }
        if (compressJS.shouldRunCompiler()) {
            compressJS.run()
            // if (Config.unpackScene > 1) {
            // oldJs.delete();
            // }
        } else {
            println("配置错误!")
        }
    }

}